//package com.mp.approvalreq.servlet.other.module;
//
//import com.mp.approvalreq.entity.dto.RequestCostDTO;
//import com.mp.approvalreq.service.SelectApprovalServicePrx;
//import com.mp.approvalreq.servlet.AbstractServlet;
//import com.mp.approvalreq.util.ServiceUtils;
//import com.mp.approvalreq.util.ValidateUtil;
//import com.mp.user.entity.User;
//import com.plusmoney.exception.RpcServerLogicalException;
//import com.plusmoney.message.SuccessMsg;
//import org.apache.commons.lang3.StringUtils;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
///**
// * 获取某月的审批支出总额
// */
//@WebServlet("/getApprovalsCostAmount")
//@Deprecated
//public class GetApprovalsCostAmount extends AbstractServlet {
//
//	private static final Logger logger = LoggerFactory.getLogger(GetApprovalsCostAmount.class);
//
//	@Override
//	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//		try {
//			User user = getReqUser(req);
//
//			String month = req.getParameter("month");
//			check(month);
//
//			logger.info("输入json:{},{}", user.getCompanyId(), month);
//
//			SelectApprovalServicePrx selectApprovalService = ServiceUtils.getSelectApprovalServicePrx();
//			RequestCostDTO requestCostDTO = selectApprovalService.getApprovalsCostAmount(user.getCompanyId(), month);
//
//			String respString = SuccessMsg.getDefaultMsg(requestCostDTO);
//
//			logger.info("返回json:{}", respString);
//
//			printJson(resp, respString);
//		} catch (Throwable e) {
//			onThrowable(req, resp, e);
//		}
//	}
//
//	private void check(String month) {
//		if (StringUtils.isEmpty(month)) {
//			throw new RpcServerLogicalException(1, "月份参数不能为空");
//		}
//
//		if (!ValidateUtil.isValidMonth(month)) {
//			throw new RpcServerLogicalException(1, "参数格式不正确");
//		}
//	}
//}
